package com.industrial.system.api;

import com.industrial.common.core.constant.ServiceNameConstants;
import com.industrial.common.core.domain.R;
import com.industrial.system.api.domain.EmEnterpriseInformationCollection;
import com.industrial.system.api.factory.RemoteWhiteFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

@FeignClient(contextId = "remoteWhiteService", value = ServiceNameConstants.WHITE_SERVICE, fallbackFactory = RemoteWhiteFallbackFactory.class)
public interface RemoteWhiteInfoService {

    @GetMapping("/common/loadAdCodeToAdBaseId/{adCode}")
    public R<String> loadAdCodeToAdBaseId(@PathVariable("adCode") String adCode);

    @GetMapping("/enterinfo/collection/preMuExistWhite/{uscc}")
    public R<Boolean> preMuExistWhite(@PathVariable("uscc") String uscc);

    @GetMapping("/enterinfo/collection/savePreMuCompanyInfoToWhite")
    public R<Boolean> savePreMuCompanyInfoToWhite(@RequestBody Map<String,Object> params);

    @PostMapping("/enterinfo/collection/preMuExistWhiteByUscc")
    public R<List<String>> preMuExistWhiteByUscc(@RequestBody List<String> uscc);

    @GetMapping("/enterinfo/collection/queryWhiteInfoByUscc/{uscc}")
    public R<EmEnterpriseInformationCollection> queryWhiteInfoByUscc(@PathVariable("uscc") String uscc);

    /**
     * 查询行政区代码所对应的行政区ID
     * @param codes
     * @return
     */
    @GetMapping("/common/queryWhiteAreaId/{codes}")
    public R<Map<String,String>> queryWhiteAreaId(@PathVariable("codes") String codes);
}
